package org.apache.servicecomb.samples.practise.houserush.sale.dao;

import org.apache.servicecomb.samples.practise.houserush.sale.aggregate.SaleQualification;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @Author: Snake Man
 * @system:
 * @DateTime: 2022/1/19 21:09
 * @Description:
 */
public interface SaleQualificationDao extends JpaRepository<SaleQualification, Integer> {

    //根据活动id和用户id查询
    SaleQualification findBySaleIdAndCustomerId(Integer saleId, Integer customerId);

    //根据客户id删除
    void deleteAllByCustomerId(int customerId);

    //根据客户id查询
    List<SaleQualification> findByCustomerId(int customerId);
}
